﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace SienSchoofsProject.Models
{
    public class Film
    {
        public int Id { get; set; }
        [Required]
        [Display(Name = "FilmName", ResourceType = typeof(Resources.Resources))]
        [StringLength(254, ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ErrorMsgFilmName")]
        public string Name { get; set; }

        [Required]
        [Range(1900, 2020, ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ErrorMsgFilmYear")]
        [Display(Name = "FilmYear", ResourceType = typeof(Resources.Resources))]
        public int Year { get; set; }

        [Required]
        [Display(Name = "FilmDirector", ResourceType = typeof(Resources.Resources))]
        [RegularExpression(@"^[a-zA-Z ]*$", ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ErrorMsgDirector")]
        [StringLength(254, ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "ErrorMsgDirectorLength")]
        public string Director { get; set; }
        
        public virtual ICollection<FilmReview> Reviews { get; set; }
        // virtual zorgt ervoor dat als de reviews nodig zijn deze nog apart opgehaald worden met een aparte query
    }
}